package com.sjyl.kaoshitong.activities;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.sjyl.kaoshitong.BaseActionBarActivity;
import com.sjyl.kaoshitong.R;
import com.sjyl.kaoshitong.fragment.FilterMainFragment;

/**
 * Created by ChangerLow on 15/6/21.
 * Email: changerlow@qq.com
 */
public class FilterActivity extends BaseActionBarActivity {
    private static final String TAG = "FilterActivity";
    private Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_container);
        toolbar = getActionBarToolbar();
        getSupportActionBar().setTitle(getString(R.string.title_filter_activity));
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
                overridePendingTransition(R.anim.do_nothing, R.anim.slide_out_to_right);
            }
        });

        FragmentManager fm = getSupportFragmentManager();
        Fragment fragment = FilterMainFragment.newInstance("");
        fm.beginTransaction().add(R.id.container, fragment).commitAllowingStateLoss();
    }


    @Override
    public void onBackPressed() {
        super.onBackPressed();
//        overridePendingTransition();
        overridePendingTransition(R.anim.do_nothing, R.anim.slide_out_to_right);
    }
}
